Global Index
HTML5 JS API Index > Web Sockets and Messaging Tutorials & Specs

PortCollection

Constructor
PortCollection()
Operations
void
add(MessagePort port)
The add() method must add the MessagePort given by the argument to the PortCollection object's list of ports, unless the MessagePort is already in the list of ports, in which case the method does nothing. (Calling this method with a port already in the list does not move the port to the end of the list.)
void
clear()
The clear() method must remove all MessagePort objects from the PortCollection object's list of ports, returning it to the initial empty state. If the list of ports is already empty, the method does nothing.
void
iterate(PortCollectionCallback callback)
The iterate() method must invoke its PortCollectionCallback argument once for each MessagePort object in the object's list of ports, in the order defined above, with each invocation being passed the corresponding MessagePort object as the callback's sole argument.
void
remove(MessagePort port)
The remove() method must remove the MessagePort given by the argument from the PortCollection object's list of ports, unless the MessagePort is not in the list of ports, in which case the method does nothing.